import request from "@/utils/request.js";

export const roleApi = {
    // 创建
    create: (data) => request.post('/sysRole', data),
    // 根据ID删除
    delete: (id) => request.delete(`/sysRole/${id}`),
    // 批量删除
    deleteBatch: (ids) => request.delete('/sysRole/batch', {
        params: {
            ids: ids.join(',')
        }
    }),
    // 更新
    update: (data) => request.put('/sysRole', data),
    // 根据ID获取
    getById: (id) => request.get(`/sysRole/${id}`),
    // 获取角色列表（分页）
    page: (params) => request.get('/sysRole/page', {params}),
    // 获取全部角色列表
    all: () => request.get('/sysRole/all')
}